Do urban parks influence migration to nearby neighborhoods?
Code
m = mapping(nyc_demo_merged,"change_precent",parks_gpd=parks_gpd)title_html =''' <h3 align="center" style="font-size:16px"><b>Population Change from 2010 to 2021 in NYC</b></h3> '''m.get_root().html.add_child(folium.Element(title_html))# Save the map as HTMLhtml_path ="map1.html"m.save(html_path)# Display the HTML file as an iframeIFrame(html_path, width=600, height=600)
After analyzing the census population growth from 2010 to 2021. It appears that there are noteworthy trends around the major urban parks in NYC.
-In Manhattan, Battery Park had the most significant population change compared to the parks such as Central Park. -In Brooklyn, the park that stand out with the most significant population is Brooklyn Bridge Park with more than 150% increase in population growth. -In Queens, the Flushing Meadows Corona Park area experienced the most significant growth among all NYC park areas. It’s worth noting that Flushing Park used to be the site of two twentieth-century World’s Fairs. As for the High Line, an elevated linear park built on a historic freight rail line, it opened in 2009. There has been a moderate population growth in the neighborhoods around it.
Understanding these demographic shifts could aid urban planners and policymakers in their decision-making process
Did neighborhoods nearby urban parks experience a decrease in population between Census 2010 and Census 2020?
Code
nyc_demo_merged_sub_loss = nyc_demo_merged[nyc_demo_merged['change_precent'] <0]m2 = mapping(nyc_demo_merged_sub_loss,"change_precent",parks_gpd=parks_gpd)title_html =''' <h2 align="center" style="font-size:16px"><b>Areas with population decrease from 2010 to 2021 in NYC</b></h3> '''m2.get_root().html.add_child(folium.Element(title_html))# Save the map as HTMLhtml_path ="map2.html"m2.save(html_path)# Display the HTML file as an iframeIFrame(html_path, width=600, height=600)
The data reveals a 10% decrease in population in some census tracts around Central Park, Brooklyn Bridge Park and Prospect Park. This could be due to increased living costs and property values and development in urban projects in other areas
Does the variation in rental prices contribute to the population decline in areas experiencing a decrease?
wsqaure = [ '003900' ]compare(nyc_demo_merged_sub_loss, wsqaure , 'Silver Lake Park')
Overall, NYC median rent and median income has increased. As for the parks areas, there highest increase in the median rent for properties is in Silver Lake Park and Brooklyn Bridge Park.
Is there a correlation between median income and the accessibility of parks?
Code
withopen('indicators_data/2388.json', 'r') asfile: park_walking_data = json.load(file)park_walking_data = pd.DataFrame(park_walking_data)park_walking_data = park_walking_data[park_walking_data.GeoType=="UHF42"]shape_file_loc ='UHF 42/UHF_42_DOHMH.shp'#convert it into geopanda dataframe def get_gpd_df(use_shape_file=True):if use_shape_file: gdf = gpd.read_file(shape_file_loc)return gdfuhf_gpd = get_gpd_df()uhf_gpd.to_crs(epsg ="4326", inplace =True)merged_ny_walking = uhf_gpd.merge( park_walking_data, left_on=["UHF"], right_on=["GeoID"])joined_data = gpd.sjoin(nyc_demo_merged, merged_ny_walking, how='left', op='within')joined_data.dropna(inplace=True)numerical_correlation, _ = pearsonr(joined_data['Value'], joined_data['median_income2010'])print(f"Pearson's correlation coefficient for year 2010: {numerical_correlation}")numerical_correlation, _ = pearsonr(joined_data['Value'], joined_data['median_income2021'])print(f"Pearson's correlation coefficient: for year 2021 {numerical_correlation}")m = mapping(joined_data,"Value",parks_gpd=parks_gpd)# Save the map as HTMLtitle_html =''' <h2 align="center" style="font-size:16px"> <b> Park Walkability </b></h3> '''m.get_root().html.add_child(folium.Element(title_html))html_path ="map3.html"m.save(html_path)# Display the HTML file as an iframeIFrame(html_path, width=600, height=600)
Pearson's correlation coefficient for year 2010: -0.263688800485939
Pearson's correlation coefficient: for year 2021 -0.12378378631103196
In order to understand whether parks are distributed equally, the correlation between park walkability and income was calculated for UF42 areas. United Hospital Fund (UHF) Neighborhoods comprise 42 adjoining zip code area designated to approximate the Community Planning Districts in NYC.
The correlation value is -0.26 for 2010 and -0.12 for 2021 which indicates a weak negative correlation. As median income increases, the “walking distance to a park” percentage tends to decrease. While the correlation is weak, it may be caused by factors such as higher median income areas prioritizing other urban projects over parks. Moreover, individuals with higher median incomes are more likely to rely on private transportation, potentially Reducing the importance of proximity to parks in influencing their choice of residence.
Is there a correlation between the presence of families in nearby neighbourhoods and the availability of Children Playgrounds?
It can be seen from the plot above that the most frequent sports facilites in NYC parks are basketball , hockey followed by Tennis. As it’s known that the favorite sports in the US are Basketball and American Football.
Code
import foliumfrom folium.plugins import MarkerClusterm = folium.Map(location=[40.747993, -74.004890] , tiles="Cartodb positron", zoom_start=10)playgrounds_cluster = MarkerCluster(name='Children Play Area').add_to(m)for idx, row in CPA_gpd.iterrows(): folium.Marker(location=[row['geometry'].centroid.y, row['geometry'].centroid.x], popup=row['name']).add_to(playgrounds_cluster)athletic_cluster = MarkerCluster(name='Athletic Facilities').add_to(m)for idx, row in AF_gpd.iterrows(): folium.Marker(location=[row['geometry'].centroid.y, row['geometry'].centroid.x] ,popup=row['primary_sp']).add_to(athletic_cluster)folium.LayerControl().add_to(m)title_html =''' <h2 align="center" style="font-size:16px"> <b>Distrubtion of Athletic Facilities and Playground Areas</b></h3> '''m.get_root().html.add_child(folium.Element(title_html))html_path ="FA_CPA_Map.html"m.save(html_path)# Display the HTML file as an iframeIFrame(html_path, width=600, height=600)
It can be seen from the map above that athletic Facilities and playground Areas are mostly distrubuted in Manhattan and Queens compared to to other boroughs
%matplotlib inlineplt.figure(figsize=(7, 3))sns.scatterplot(x='Total_Families', y='CPA_Count', data=CPA_fam_count)plt.title('Number of Playgrounds vs Total Families')plt.xlabel('families count')plt.ylabel('Number of children Play Area')plt.show()
Parks play a vital role in enhancing children’s well-being through spaces for physical activities like playgrounds and sports facilities. Investigating the correlation between the number of families and the availability of children’s playgrounds can aid in future planning for facilities and contribute to overall community well-being.
the correlation between the number of playgrounds and families in the NYC was calculated. It’s 0.078 suggests a very weak positive correlation.
Factors that could lead to this include: 1- other urban plannings projects priotrization 2-economic factors in the areas which contribute to whether an investment in playgrounds are possible 3- the presence of private areas that are considered as alternatives to public parks 4-Data limitation, since the result was acquired through spatial merge between families census tracts geospatial distrubtion and the map of playgrounds in NYC parks
Is there a corrleation between regular exercise and the avaliability atheltic facilities at parks ?
Code
withopen('indicators_data/2060.json', 'r') asfile: physical_activity_data = json.load(file)physical_activity_data = pd.DataFrame(physical_activity_data)physical_activity_data = physical_activity_data[physical_activity_data.GeoType=="UHF42"]physical_activity_data.GeoID = physical_activity_data.GeoID.astype(float)physical_activity_data = physical_activity_data[physical_activity_data.Time=='2019']merged_ny_physical = uhf_gpd.merge( physical_activity_data, left_on=["UHF"], right_on=["GeoID"])joined_gdf = gpd.sjoin(AF_gpd, merged_ny_physical, how='inner', op='intersects')tract_aggregated = joined_gdf.groupby(['GeoID','borough' ])['system'].count().reset_index()#system is the count of facilites in each areamerged_data = pd.merge(tract_aggregated, physical_activity_data, on=['GeoID'])merged_data.drop_duplicates(inplace=True)correlation_coefficient, p_value = pearsonr(merged_data['system'], merged_data['Value'])correlation_coefficient
-0.2820924647154564
Code
plt.figure(figsize=(7, 3))sns.scatterplot(x='Value', y='system', data=merged_data)plt.title('Park Accessibility Vs Exercise rate')plt.xlabel('% Of recent exercise per area responses')plt.ylabel('Number of atheltic facilities')plt.show()
Accessible athletic facilities could encourage physical activity which results in overall community well-being. The physical activity data was acquired from NYC Environment and Health Data Portal for the year 2017. They define Recent exercise as “Adults reporting exercise in the past 30 days (from when they were surveyed)”. In order to examine the relationship between the presence of public athletic facilities in NYC parks and physical activity levels, a correlation analysis was conducted.
Surprisingly, the result revealed a mild negative correlation (-28). It is crucial to note that the NYC Environment and Health Data Portal emphasizes that their data is based on estimates from small numbers and should be interpreted with caution.
Further studies could be conducted to determine the significance of this correlation, as it would provide valuable insights. Nowadays, there is a growing preference for personal trainers and private gyms over traditional athletic facilities. Additionally, it’s possible that the distribution of athletic facilities does not align with the exercise habits of the population in a given area.
Is there a corrleation between exercise and accessibility of parks?
It can be seen from the map that the borough with the highest recent physical activity is Manhattan for the year 2020.
Code
#ref:#https://a816-dohbesp.nyc.gov/IndicatorPublic/data-explorer/physical-activity/?id=2060park_walking_data = pd.DataFrame(park_walking_data)park_walking_data = park_walking_data[park_walking_data.GeoType=="UHF42"]physical_activity_data = physical_activity_data[physical_activity_data.Time=='2017']merged_ny_walking = uhf_gpd.merge( park_walking_data, left_on=["UHF"], right_on=["GeoID"])plot = merged_ny_walking.hvplot( c="Value", groupby="Time", frame_width=600, frame_height=600, geo=True, dynamic=False, cmap="Greens", hover_cols=["GEOID"])plot.opts(title='Walking Distance to a Park in NY by Neighbourhood in 2017')
Manhattan has the most park walkability among other boroughs.The could be due to parks density since Manhattan is the most densely populated borough in NYC
Code
merged_walking_corr = physical_activity_data.merge( park_walking_data, on=['GeoID', 'Time'])correlation_coefficient, p_value = pearsonr(merged_walking_corr.Value_x,merged_walking_corr.Value_y)#| echo: true #| code-fold: trueplt.figure(figsize=(7, 3))sns.scatterplot(x='Value_x', y='Value_y', data=merged_walking_corr)plt.title('Park Accessibility Vs Exercise rate')plt.xlabel('% Of recent exercise per area responses')plt.ylabel('% of Accessability to Parks per responses')plt.show()correlation_coefficient
0.28957159180561953
A correlation of 0.28 suggests a weak positive correlation As the walkability to the park in an area increases, the rate of exercise in that area tends to increase slightly. When parks are more walkable, residents are more likely to utilize them for physical activities Also it promotes the neighborhood community to engage in social activites that would motiavte more residents.